<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="prc.*" %>  

<%
  	String error="";
  	String message = request.getParameter("message");
  	String title = request.getParameter("title");
  	int cat = Integer.parseInt(request.getParameter("cat"));
	int forum = Integer.parseInt(request.getParameter("f"));
	Categorie categorie = ForumManagement.categorii.get(cat);
	Sectiune sectiune = categorie.sectiuni.get(forum);
	Topic newTopic = new Topic(UserManagement.getCurrentUser(session), title, new Mesaj(message, UserManagement.getCurrentUser(session)), ForumManagement.categorii.get(cat).sectiuni.get(forum).topicuri.size());
	ForumManagement.categorii.get(cat).sectiuni.get(forum).topicuri.add(0, newTopic);
	int thread = newTopic.getID();
	//sectiune.setLastPostUser(UserManagement.getCurrentUser(session));
  %>


<jsp:include page="top.jsp"/>



<div id="page-body">


	<div class="panel">
		<div class="inner"><span class="corners-top"><span></span></span>
		<h2>Thread created</h2>
		<fieldset class="fields2">
			Thread has been created. Please click <a href= "./viewthread.jsp?cat=<% out.print(cat); %>&f=<% out.print(forum); %>&t=<% out.print(thread); %>">here</a> to go to the new thread.
		</fieldset>
	</div>
	<div class="panel">
		<div class="inner"><span class="corners-top"><span></span></span>
	
		<span class="corners-bottom"><span></span></span></div>
	</div>


</div>


</div>

<jsp:include page="bottom.jsp"/>